<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>爱选</title>
<meta name="keywords" content="" />
<meta name="description"  content="" />
<link href="/static/css/ixuan.css" rel="stylesheet" type="text/css" />
</head>
<script type="text/javascript" src="/static/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/static/js/i.js"></script>
<script   type= "text/javascript">         
$(document).ready(function(){
//    $('div').find('.zhong')
	$('#a').hover(
	  function () {
		$(".a").toggleClass('ahover');
	  },
      function () {
		$(".a").toggleClass('ahover');
      }
	);
	$('#b').hover(
	  function () {
		$('.b').toggleClass('bhover');
	  },
      function () {
		$('.b').toggleClass('bhover');
      }
	);//投票页面鼠标经过变色

	$('.option4').live('click',function(){
		var pid=$('#pid').val();
		var cid=$(this).find('#cid').val();
		var rank=$(this).find('#rank').val();
		$.ajax({
			type:"get",
			url:"/problem/"+pid+"/answer",
			data:'cid=' + cid + '&rank='+rank,
			success : function(msg) {
				   
			}
		});

	    $(this).children('.a').addClass('zhong');
        $(this).children('.b').addClass('zhong');
		$('.percent').css({'visibility': 'visible'});
		$('.option4').die('click');
		$('.a').attr('title','您已完成选择');
		$('.b').attr('title','您已完成选择');
    });//投票页面鼠标点击选

	$('.imgShowScr a').click(function(){
	    var imgshow = $(this).attr('name');
		$('.screenImg').attr('src',imgshow);
		$('#backUp').slideDown('fast');
		$('#backU').fadeIn('fast');
	});
	$('#backUp').click(function(){
		$('#backUp').hide();
		$('#backU').fadeOut('fast');
	});//打卡关闭图片展示

	$('.addNewCC').click(function(){
        $(this).fadeOut('fast');
		$('.addNewCom').fadeIn('fast');
	});

	var pid=$('#pid').val();
	$.ajax({
		type:"get",
		url:"/checkAnswer",
		data:'pid='+pid,
		success : function(msg) {
			   if (msg == 2){
				   $('.option4:last').click();
				}else if (msg == 1){
					 $('.option4:first').click();
				}
		}
	});

});

</script>
<body>
<div id="backUp" style="display:none;"></div>
<div id="backU" style="display:none;"><img src="" class="screenImg" alt="" /></div>
<div class="top">
    <div class="header">
      <div class="logo"><a href="http://localhost:8080"><img src="/static/images/logo.gif" alt="爱选" /><img src="/static/images/logotext.gif" alt="爱选" /></a></div>
      <div class="headInfo">
          <div class="myInfo">您好，{{user.nickname }} ! <a href="/userhome/{{ user.uid }}">我的爱选</a> <a href="/account/"> 个人中心 </a>  <a href="/logout/">退出</a></div>
          <input type="hidden" id="uid" value="{{user.pid}}">
          <div class="search"><input name="" type="text" class="seaIn" /><input name="" type="button" class="seaSo" value="搜索"/></div>
      </div>
    </div>
</div>
<div class="wrapper">
    <div class="main">
      <h1><span><a href="/type/{{ type.tid }}">{{ type.name }}</a></span>{{ problem.title }}</h1>
        <div class="describe">
      	{{ problem.pdesc.text }}     
      <strong></strong>
           <div class="imgShowScr">
              <a href="###" name="{{ choose_a.cid }}">A描述的图片<br /><img src="{{choose_a.photo}}" alt="" /></a>
 
              <a href="###" name="{{ choose_b.cid }}">B描述的图片<br /><img src="{{choose_b.photo}}" alt="" /></a>

           </div>
        </div>
        <input type="hidden" id="pid" value="{{problem.pid}}">
      <div id="a" class="option4">
      	  
          <div title="点击完成选择" class="a"></div>
            <div class="percent">票数：{{choose_a.count}} </div>
           

          <div class="select">{{ choose_a.description }}</div>
          <input type="hidden" id="cid" value="{{choose_a.cid}}">
 			<input type="hidden" id="rank" value="{{choose_a.rank}}">
         
        </div>
        <div id="b" class="option4">
          <div title="点击完成选择" class="b"></div>
            <div class="percent">票数：{{choose_b.count}}</div>
            
  
          <div class="select">{{ choose_b.description }}</div>
          <input type="hidden" id="cid" value="{{choose_b.cid}}">
           <input type="hidden" id="rank" value="{{choose_b.rank}}">
        </div>
        <h2>&gt; 评论</h2>
        <div class="allList allList2">
            <ul>
                    <a class="addNewCC" style="padding:10px; display:block" href="###"><img src="/static/images/add16_16.gif"  alt=""/>添加评论</a> 
                <li class="addNewCom" style="display:none">
                    <a href="#"><img src="{{ user.image }}" class="userImg2" alt="" /></a> 
                        <form  action="/problem/{{ problem.pid }}/addComment/" method="post">
                        <textarea name="content" rows="3" class="pinglunk" tip="输入你的评论..."></textarea>  <input name="" type="submit" class="seaSo" value="评论" />
                      	</form>
                </li>
                {% for comment in comments %}
                <li>
                    <a href="/userhome/{{ comment.uid }}"><img src="{{ comment.image }}" class="userImg2" alt="" /></a> 
                    <span>{{ comment.content }}</span>                </li>
            	{% endfor %}
            </ul>
      </div>
        
  </div>
    <div class="right">
        
        <div class="h10"></div>
       <a href="/problem/create/"><img src="/static/images/tounow.gif" alt="立即发起投票" /></a>
       <div class="typeRight">
            <ul>
            {% for type in types %}
                <li class="{{type.class}}"><a href="/type/{{type.tid}}/"><span></span>{{type.name}}</a></li>
            {% endfor %}
            </ul>
            <br clear="all" />
        </div>
        <div class="hot">
            <div class="hotTie">
                <ul>
                    <li id="month" class="hotN">本月热门投票</li>
                    <li id="week">本周热门投票</li>
                </ul>
            </div>
            <div class="hotCon">
                <ol class="month">
                	{% for p in monthHotProblems %}
                	<li><a href="/problem/{{ p.pid }}/">{{ p.title }}</a></li>
            		{% endfor %}            	
            	</ol>
            	<ol class="week" style="display:none">
                	{% for p in weekHotProblems %}
                	<li><a href="/problem/{{ p.pid }}/">{{ p.title }}</a></li>
            		{% endfor %}            	
            	</ol>
            </div>
        </div>
    </div>
</div>
<div class="foot">
    <div>关于我们 · 联系我们 · 意见反馈   © 2011 dXXXX.com, all rights reserved                                         ICP：34325434667</div>
</div>
</body>
</html>
